<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<%@ taglib  uri="http://java.sun.com/jsp/jstl/core"  prefix="c" %>  
<%@ taglib  uri="http://java.sun.com/jsp/jstl/functions"  prefix="fn" %> 
<script type="text/javascript" src="<%=request.getContextPath() %>/My97DatePicker/WdatePicker.js"></script>
<link    rel="stylesheet"    href="<%=request.getContextPath() %>/css/index3.css"  type="text/css">
<script type="text/javascript"  src="<%=request.getContextPath() %>/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript"  src="<%=request.getContextPath() %>/js/jquery.validate.js"></script> 
<html>
<head>

<script type="text/javascript">

function ps() {
	var cids=$("input:checked").map(function () {
		return this.value
	}).get().join()
	
	$("#a").val(cids)
	 alert(cids)
	$.post("/add.do",$("form").serialize(),function(data){
		if(data>0){
			alert("添加成功")
		}
	},"json"
			) 
	
}

</script>

<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<form >



	<input type="text" name="cids" id="a" >
	<td>电影名</td><input type="text" name="mname" ><br>
	<td>介绍</td><input type="text" name="jieshao" ><br>
	<td>导演</td><input type="text" name="daoyan" ><br>
	<td>上映日期</td><input type="text" name="datea" ><br>

分类<br>

<c:forEach items="${list }" var="c">
<input type="checkbox" value="${c.cid }" ${m } >${c.cname }<br>
</c:forEach><br>
<input type="button" value="添加" onclick="ps()">

</form>

</body>
</html>